Student Solution

-->

"Education is the most powerful weapon which you can use to change the world”
– Nelson Mandela

1 University

1 Course

1 Subject

6-1 Project One

6-1 Project One

Q Competencies In this project, you will demonstrate your mastery of the following competencies: • Create a structured database through the use of relational concepts • Implement basic processing functionalities to create new structured database environments Step One: Scenario You’re working as a database administrator for Quantigration, a networking equipment manufacturer. The company has grown quickly, and it’s still figuring out its internal business processes. Customer return merchandise authorizations (RMAs) are used to track shipments for defective or incorrect parts. The company has identified RMAs as a specific problematic area. Your supervisor at Quantigration asked you to create a database for a new software application that will be used for processing RMAs. Because there are several locations where merchandise can be taken in, the application must also record where items are received. This system will also capture where the equipment is going next: repair, scrap, or refurbishing and resale. The warehouse shipping and receiving employees at your company will be using this application; they are considered your “end users” for the application. Part of their job is to process customer return shipments. This involves the following steps: • Assess the quality of the items being returned for defects • Identify missing parts • Identify signs of obvious wear and tear (such as dents or scratches to the equipment) Step One: Directions Create a Database The data architect on your DevOps team has come to you with a logical database diagram referred to as an entity relationship diagram (ERD). This is documentation of the tables, their relationships to each other, their attributes, and any primary or foreign keys on those attributes. These elements are required to create the new database. Prior to beginning, review the example ERD in the Quantigration RMA Diagram document in Supporting Materials. Create your three tables, named Customers, Orders, and RMA, in the QuantigrationUpdates database based on the example you‘ve been given. To do this, complete the following steps and place your work in the provided Database Documentation Template: 1. Navigate to your online integrated development environment (IDE). The next set of steps will help you write SQL commands to create tables that demonstrate relationships based on the ERD. 2. Create a database schema called QuantigrationUpdates that will hold tables by using SQL commands. List it out to the screen. 3. Using the ERD as a reference, create the following tables with the appropriate attributes and keys: o A table to store customer information with a primary key of Customer ID o A table to store order information with a primary key of Order ID and a foreign key of Customer ID o A table to store RMA information with a primary key of RMA ID and a foreign key of Order ID STOP: Make sure to save your work before moving on to Step Two of this process. You’ll continue to work in Codio and use the documentation you started in Step One. Step Two: Scenario Now it’s time to populate the database with records and run some basic queries against those tables. You’ll be using the QuantigrationUpdates database and the three tables you created in Step One to do the following: • Import data from the CSV data files into the tables • Perform queries against those tables • Create an output listing to the screen of the query results The shipping and receiving team that you are working with has been keeping records of their RMAs in spreadsheets, and your team has been creating its database in MySQL. The information that they have is detailed and won’t need cleaning. The data in the tables can be exported to CSV files. The data should also align with the columns and data types in your tables. Step Two: Directions Load and Query the Data In Step One, you created a customer RMA database using SQL to create tables and placed your work in the database documentation template. To complete your objectives in this step, continue to place your work in the database documentation template and follow these directions: • Please note before you begin that the three data files being used for this project are preloaded into Codio: o RMA.csv o Customers.csv o Orders.csv 1. 1. 1. Import the data from each file into tables. a. Use the QuantigrationUpdates database, the three tables you created, and the three CSV files preloaded into Codio. ? Use the import utility of your database program to load the data from each file into the table of the same name. You’ll perform this step three times, once for each table. 2. Write basic queries against imported tables to organize and analyze targeted data. For each query, include a screenshot of the query and its output. You should also include a 1- to 3-sentence description of the output. ? ? Write an SQL query that returns the count of orders for customers located only in the city of Framingham, Massachusetts. i. This query will use a table join between the Customers and Orders tables. The query will also use a WHERE clause. ii. How many records were returned? ? Write an SQL query to select all of the customers located in the state of Massachusetts. i. Use a WHERE clause to limit the number of records in the customers table to only those who are located in Massachusetts. ii. Record an answer to the following question: How many records were returned? ? Write an SQL query to insert four new records into the orders and customers tables using the following data: Customers Table CustomerID FirstName LastName StreetAddress City State ZipCode Telephone 100004 Luke Skywalker 15 Maiden Lane New York NY 10222 212-555-1234 100005 Winston Smith 123 Sycamore Street Greensboro NC 27401 919-555-6623 100006 MaryAnne Jenkins 1 Coconut Way Jupiter FL 33458 321-555-8907 100007 Janet Williams 55 Redondo Beach Blvd Torrence CA 90501 310-555-5678 ? Orders Table OrderID CustomerID SKU Description 1204305 100004 ADV-24-10C Advanced Switch 10GigE Copper 24 port 1204306 100005 ADV-48-10F Advanced Switch 10 GigE Copper/Fiber 44 port copper 4 port fiber 1204307 100006 ENT-24-10F Enterprise Switch 10GigE SFP+ 24 Port 1204308 100007 ENT-48-10F Enterprise Switch 10GigE SFP+ 48 port ? ? In the Customers table, perform a query to count all records where the city is Woonsocket, Rhode Island. ? How many records are in the customers table where the field "city" equals "Woonsocket"? ? In the RMA database, update a customer's records. ? Write an SQL statement to select the current fields of status and step for the record in the RMA table with an OrderID value of "5175." ? What are the current status and step? ? Write an SQL statement to update the status and step for the OrderID, 5175 to status = "Complete" and step = "Credit Customer Account." ? What are the updated status and step values for this record? Provide a screenshot of your work. ? Delete RMA records. ? Write an SQL statement to delete all records with a reason of "Rejected". ? How many records were deleted? Provide a screenshot of your work. 3. Because of a new company branding initiative, you’ve been asked to change the name of the “Customer” to “Collaborator.” Update your existing table using SQL based on this change in requirements. Copy and paste the SQL you write to do the following: . Rename all instances of “Customer” to “Collaborator.” 4. Create an output file of the required query results. Write an SQL statement to list the contents of the Orders table and send the output to a file that has a .csv extension. 5. What to Submit To complete this project, you must submit the following: Database Documentation Complete and submit the Database Documentation Template. This will be where you capture the work that you’ve done in both Step One and Step Two. Follow the specific instructions for the directions outlined here and within the template itself. Supporting Materials The CSV data files that you’ll be working with can be found in Codio. They are listed vertically in the left pane of your Codio web interface. The following resource(s) may support your work on the project: Document: Database Documentation Template Example As you complete your database documentation template, refer to this document for an example of how to insert screenshots to capture your work. Document: Quantigration RMA Diagram This ERD shows the relationships of entities in the database. Download this ERD and use it to support your work on this project. A text version of the diagram is available: Quantigration RMA Diagram Text Version.

View Related Questions

Solution Preview

Step One: Create a Database 1. Navigate to your online integrated development environment (IDE). List and record the SQL commands that you used to complete this step here: [Insert screenshot and brief explanation here.] Opened Codio Click new terminal Enter mysql 2. Create a database schema called QuantigrationUpdates. List out the database name. Provide the SQL commands you ran against MySQL to successfully complete this in your answer: [Insert screenshot and brief explanation here.] 3. Using the entity relationship diagram (ERD) as a reference, create the following tables with the appropriate attributes and keys: a. A table named Customers in the QuantigrationUpdates database, as defined on the project ERD. Provide the SQL commands you ran against MySQL to complete this successfully in your answer: [Insert screenshot and brief explanation here.]